package com.testdemo.hadoop2.hdfs;

import org.junit.Before;
import org.junit.Test;

import java.io.File;

/**
 * @author : zouren
 * @date : 2019/11/13 12:12
 * @deprecated :
 */
public class HdfsTest {
    HdfsConfig config = null;
    @Test
    public void mkdir() {
        HdfsService.mkdir(config,"/test/java");
    }
    @Test
    public void upload() {
        File abcFile = new File("testCVS/abc.csv");
        System.out.println(abcFile.getAbsolutePath());
        System.out.println(abcFile.getName());
        HdfsService.upload(config, abcFile.getAbsolutePath(), "/test/java/" + abcFile.getName());
    }

    @Before
    public void init() {

        config = new HdfsConfig("192.168.31.128", "9000", "root");
    }

    @Test
    public void download() {
        HdfsService.download(config,"/test/java/abc.csv","testCVS/abchdfs.csv");
    }


    @Test
    public void delete() {
        HdfsService.delete(config,"/test/java/abc.csv");
    }





}
